package org.moonlight.jvm.natives.java.lang.floats;

import org.moonlight.jvm.natives.AbstractNativeMethod;
import org.moonlight.jvm.rtda.exclusive.Frame;

/**
 * java.lang.Float public static native float intBitsToFloat(int val)
 *
 * @author Moonlight
 * @createTime 2023/9/28 11:42
 **/
public class IntBitsToFloat extends AbstractNativeMethod  {
    public IntBitsToFloat() {
        super("java/lang/Float", "intBitsToFloat", "(I)F");
    }

    @Override
    public void nativeMethod(Frame frame) {
        int val = frame.getLocalVars().getInt(0);
        float floatVal = Float.intBitsToFloat(val);
        frame.getOperandStack().pushFloat(floatVal);
    }
}
